package com.dianping.cat.consumer.transaction.model.entity;

import com.dianping.cat.consumer.transaction.model.BaseEntity;
import com.dianping.cat.consumer.transaction.model.IVisitor;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;




public class Machine
  extends BaseEntity<Machine>
{
  private String m_ip;
/* 15 */   private Map<String, TransactionType> m_types = new ConcurrentHashMap();





/* 21 */   public Machine(String ip) { this.m_ip = ip; }




/* 26 */   public void accept(IVisitor visitor) { visitor.visitMachine(this); }


  public Machine addType(TransactionType type) {
/* 30 */     this.m_types.put(type.getId(), type);
/* 31 */     return this;
  }


  public boolean equals(Object obj) {
/* 36 */     if (obj instanceof Machine) {
/* 37 */       Machine _o = (Machine)obj;

/* 39 */       if (!equals(getIp(), _o.getIp())) {
/* 40 */         return false;
      }

/* 43 */       return true;
    }

/* 46 */     return false;
  }


/* 50 */   public TransactionType findType(String id) { return (TransactionType)this.m_types.get(id); }


  public TransactionType findOrCreateType(String id) {
/* 54 */     TransactionType type = (TransactionType)this.m_types.get(id);

/* 56 */     if (type == null) {
/* 57 */       synchronized (this.m_types) {
/* 58 */         type = (TransactionType)this.m_types.get(id);

/* 60 */         if (type == null) {
/* 61 */           type = new TransactionType(id);
/* 62 */           this.m_types.put(id, type);
        }
      }
    }

/* 67 */     return type;
  }


/* 71 */   public String getIp() { return this.m_ip; }



/* 75 */   public Map<String, TransactionType> getTypes() { return this.m_types; }






/* 89 */   public void mergeAttributes(Machine other) { assertAttributeEquals(other, "machine", "ip", this.m_ip, other.getIp()); }




/* 94 */   public TransactionType removeType(String id) { return (TransactionType)this.m_types.remove(id); }


  public Machine setIp(String ip) {
/* 98 */     this.m_ip = ip;
/* 99 */     return this;
  }

  public Machine() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/transaction/model/entity/Machine.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */